package com.groupbuying.provider.service.impl;


import com.groupbuying.provider.constants.CommonConstants;
import com.groupbuying.provider.dao.StoreDeptDao;
import com.groupbuying.provider.domain.StoreDeptDO;
import com.groupbuying.provider.service.StoreDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class StoreDeptServiceImpl implements StoreDeptService {
	@Autowired
	private StoreDeptDao storeDeptDao;
	
	@Override
	public StoreDeptDO get(String uuid){
		return storeDeptDao.get(uuid);
	}
	
	@Override
	public List<StoreDeptDO> list(Map<String, Object> map){
		return storeDeptDao.list(map);
	}
	

	public int count(Map<String, Object> map){
		return storeDeptDao.count(map);
	}
	



	public Map<String, StoreDeptDO> getDeptMapByUuids(List<String> uuids) {
		Map map = new HashMap();
		map.put("uuids",uuids);
		map.put("delflag", CommonConstants.COMMON_FLAG_UNDEL);
		List<StoreDeptDO> retList = storeDeptDao.getByUuids(map);
		Map<String, StoreDeptDO> retMap = new HashMap<String, StoreDeptDO>();
		for(StoreDeptDO ele : retList) {
			retMap.put(ele.getUuid(), ele);
		}
		return retMap;
	}


}
